package personal.causeless.driver.browser;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

import personal.causeless.driver.drivers.BasicDriver;
import personal.causeless.driver.drivers.ExtendsDriver;

public class MyInternetExplore extends BasicDriver implements ExtendsDriver {

	public MyInternetExplore(){
		
		try {
			driver = new RemoteWebDriver(new URL(REMOTE_ADDRESS), DesiredCapabilities.internetExplorer());
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	@Override
	public void implicitlyWait(Integer seconds) {
		driver.manage().timeouts().implicitlyWait(seconds, TimeUnit.SECONDS);
	}
	@Override
	public void pageLoadTimeout(Integer seconds) {
		driver.manage().timeouts().pageLoadTimeout(seconds, TimeUnit.SECONDS);
	}
	@Override
	public void setScriptTimeout(Integer seconds) {
		driver.manage().timeouts().setScriptTimeout(seconds, TimeUnit.SECONDS);
	}
	@Override
	public ExtendsDriver extendsDriver() {
		return new MyInternetExplore();
	}

}
